const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
  return sequelize.define('base_construction_licence_process', {
    id: {
      autoIncrement: true,
      type: DataTypes.BIGINT,
      allowNull: false,
      primaryKey: true,
      comment: "唯一标识"
    },
    messageId: {
      type: DataTypes.STRING(64),
      allowNull: true,
      comment: "原信息ID",
      field: 'message_id'
    },
    singlePrjNames: {
      type: DataTypes.TEXT,
      allowNull: true,
      comment: "单项名称",
      field: 'single_prj_names'
    },
    handlingPerson: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "经办人姓名",
      field: 'handling_person'
    },
    handlingPersonPhone: {
      type: DataTypes.STRING(20),
      allowNull: true,
      comment: "经办人联系电话",
      field: 'handling_person_phone'
    },
    entpStatus: {
      type: DataTypes.STRING(20),
      allowNull: true,
      comment: "企业端状态",
      field: 'entp_status'
    },
    serialNumber: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "流水号",
      field: 'serial_number'
    },
    applyCount: {
      type: DataTypes.DECIMAL(10,0),
      allowNull: true,
      comment: "申请次数",
      field: 'apply_count'
    },
    applyItem: {
      type: DataTypes.STRING(10),
      allowNull: true,
      comment: "申请类型字典（1：新申请 6：遗失补办",
      field: 'apply_item'
    },
    returnCount: {
      type: DataTypes.DECIMAL(10,0),
      allowNull: true,
      comment: "退回次数",
      field: 'return_count'
    },
    creationTime: {
      type: DataTypes.STRING(20),
      allowNull: true,
      comment: "创建时间",
      field: 'creation_time'
    },
    printtype: {
      type: DataTypes.STRING(20),
      allowNull: true,
      comment: "施工许可证打印方式（1事项2单项3单位）"
    },
    handlingpersonidcard: {
      type: DataTypes.STRING(20),
      allowNull: true,
      comment: "经办人身份证号"
    },
    rowGuid: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "省厅对接id",
      field: 'row_guid'
    },
    isUploadmining: {
      type: DataTypes.STRING(2),
      allowNull: true,
      comment: "是否上传探勘表",
      field: 'is_uploadmining'
    },
    acceptancePeriod: {
      type: DataTypes.STRING(32),
      allowNull: true,
      comment: "受理期限",
      field: 'acceptance_period'
    },
    isShouli: {
      type: DataTypes.STRING(2),
      allowNull: true,
      comment: "是否受理（y、n）",
      field: 'is_shouli'
    },
    acceptTime: {
      type: DataTypes.STRING(32),
      allowNull: true,
      comment: "受理时间",
      field: 'accept_time'
    },
    auditPeriod: {
      type: DataTypes.STRING(32),
      allowNull: true,
      comment: "审核期限",
      field: 'audit_period'
    },
    tuihuiType: {
      type: DataTypes.STRING(2),
      allowNull: true,
      comment: "审核退回类型(1 全部退回,2 只整改,3只探勘)",
      field: 'tuihui_type'
    },
    acceptId: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "窗口受理人ID",
      field: 'accept_id'
    },
    initialAuditId1: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "初审1ID",
      field: 'initial_audit_id1'
    },
    initialAuditName1: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "初审1姓名",
      field: 'initial_audit_name1'
    },
    initialAuditTime1: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "初审1时间",
      field: 'initial_audit_time1'
    },
    checkMark1: {
      type: DataTypes.STRING(10),
      allowNull: true,
      comment: "初审1审核标志位",
      field: 'check_mark1'
    },
    initialAuditOpinion1: {
      type: DataTypes.TEXT,
      allowNull: true,
      comment: "初审1意见",
      field: 'initial_audit_opinion1'
    },
    initialAuditId2: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "初审2ID",
      field: 'initial_audit_id2'
    },
    initialAuditName2: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "初审2姓名",
      field: 'initial_audit_name2'
    },
    initialAuditTime2: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "初审2时间",
      field: 'initial_audit_time2'
    },
    checkMark2: {
      type: DataTypes.STRING(10),
      allowNull: true,
      comment: "初审2审核标志位",
      field: 'check_mark2'
    },
    initialAuditOpinion2: {
      type: DataTypes.TEXT,
      allowNull: true,
      comment: "初审2意见",
      field: 'initial_audit_opinion2'
    },
    duplicateAuditId: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "复审ID",
      field: 'duplicate_audit_id'
    },
    duplicateAuditName: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "复审姓名",
      field: 'duplicate_audit_name'
    },
    duplicateAuditTime: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "复审时间",
      field: 'duplicate_audit_time'
    },
    duplicateAuditOpinion: {
      type: DataTypes.TEXT,
      allowNull: true,
      comment: "复审意见",
      field: 'duplicate_audit_opinion'
    },
    directorAuditId: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "处长审核ID",
      field: 'director_audit_id'
    },
    chairmanAuditId: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "主任审核ID",
      field: 'chairman_audit_id'
    },
    isLinked: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "是否联办",
      field: 'is_linked'
    },
    officeStatus: {
      type: DataTypes.STRING(10),
      allowNull: true,
      comment: "联办状态",
      field: 'office_status'
    },
    remainingTime: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "剩余时限",
      field: 'remaining_time'
    },
    deliveryMethod: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "领证方式",
      field: 'delivery_method'
    },
    deliveryInfo: {
      type: DataTypes.STRING(1000),
      allowNull: true,
      comment: "邮寄信息",
      field: 'delivery_info'
    },
    completeTime: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "办结时间",
      field: 'complete_time'
    },
    isLocaked: {
      type: DataTypes.STRING(2),
      allowNull: true,
      comment: "是否锁定",
      field: 'is_locaked'
    },
    projid: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "申办号(数据对接用)"
    },
    projpwd: {
      type: DataTypes.STRING(6),
      allowNull: true,
      comment: "查询密码（数据对接用）"
    },
    ifHebing: {
      type: DataTypes.STRING(10),
      allowNull: true,
      comment: "是否合并办理： 1：合并。0；不合并",
      field: 'if_hebing'
    },
    ifRightNow: {
      type: DataTypes.STRING(10),
      allowNull: true,
      comment: "是否采用“建成即使用”审批模式",
      field: 'if_right_now'
    },
    isDeleted: {
      type: DataTypes.TINYINT,
      allowNull: true,
      comment: "是否删除",
      field: 'is_deleted'
    },
    createdUser: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "创建人",
      field: 'created_user'
    },
    createdTime: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "本系统创建时间",
      field: 'created_time'
    },
    updatedUser: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "修改人",
      field: 'updated_user'
    },
    updatedTime: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "修改时间",
      field: 'updated_time'
    }
  }, {
    sequelize,
    tableName: 'base_construction_licence_process',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "id" },
        ]
      },
    ]
  });
};
